﻿@using MvcFileUploader.HtmlHelper
@using MvcFileUploader.Models

@{
    ViewBag.Title = "销售单导入";
    Layout = "~/Views/Shared/_Layout.cshtml";
    List<Maxleaf.EDI.Client.Models.DBInfoModel> DBs = ViewBag.DBs as List<Maxleaf.EDI.Client.Models.DBInfoModel>;
    var ui = UploadUI.Bootstrap;
}

<div class="control-group">
                        @Html.Label("选择导入帐套：")
                        <select id="DBSelect">
                        @foreach (var db in DBs)
                        {   
                            var optId=db.DBId;
                            var optValue = db.DBId;
                            <option id="@optId" value="@optValue">
                                @db.DBName
                            </option>
                        }
                    </select>

    <div class="well">
     
        @(
        Html.MvcFileUpload()
        .UploadAt(Url.Action("UploadFile"))
        .UIStyle(ui)
        .WithFileTypes(@"/(\.|\/)(xls)$/i")
        .WithMaxFileSize(5000000)
        .AddFormField("dbId", "")
        .RenderInline("_MvcFileupload")
        )
        
    </div>
                    </div>

<script type="text/javascript">
    
    $(document).ready(function(){
        $("#DBSelect").change(function()
        {
            //alert($("#DBSelect").val());
            $("#dbId").attr("value", $("#DBSelect").val());

        });
        
        $("#dbId").attr("value", $("#DBSelect").val());
        //alert($("#dbId").val());
    });

</script>